#ifndef __METER_H__
#define __METER_H__

/* Data Types ------------------------------------------------------------------------------------*/

typedef enum {
	METER_MODE_AV = 0, /**< 光圈优先 */
	METER_MODE_TV = 1, /**< 快门优先 */
	METER_MODE_MAX
} meter_mode_e;

#ifdef __cplusplus
extern "C" {
#endif

meter_mode_e meter_mode_get(void);
meter_mode_e meter_mode_switch(void);

uint32_t iso_get_idx(void);
float iso_get_val(void);
const char* iso_get_string(void);
uint32_t iso_idx_increment(void);
uint32_t iso_idx_decrement(void);

uint32_t av_get_idx(void);
void av_set_idx(uint32_t id);
float av_get_val(void);
const char* av_get_string(void);
uint32_t av_idx_increment(void);
uint32_t av_idx_decrement(void);

uint32_t tv_get_idx(void);
void tv_set_idx(uint32_t idx);
float tv_get_val(void);
const char* tv_get_string(void);
uint32_t tv_idx_increment(void);
uint32_t tv_idx_decrement(void);

double calc_ev_by_lux(double lux);
uint32_t calc_shutter_speed(double ev, float iso, float N);
uint32_t calc_aperture(double ev, float iso, float sp);

#ifdef __cplusplus
}
#endif

#endif /* !__METER_H__ */
